<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			//1.创建对象
			const xhr = new XMLHttpRequest();
			/*
			  参数1:请求方式
			  参数2:请求URL
			*/
			//2.初始化一个请求
			xhr.open("GET", "https://api.apiopen.top/api/sentences");
			//3.发送请求
			xhr.send();
			//4.注册事件
			xhr.onreadystatechange = function() {
				//200 成功
				if (xhr.readyState == 4 && xhr.status == 200) {
					//获取响应数据
					let s = xhr.responseText;
					console.log(s);
				}
			}
		</script>
	</head>
	<body>
	</body>
</html>
